<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <p>typeof 关键字用于判断数据类型</p>
    <p>如typeof age等</p>
    <hr>
    <h2>null和undefined</h2>
    <p>null一般代表 <strong>对象</strong> 为“没有”</p>
    <p>undefined一般代表 <strong>数值</strong> 为“没有”</p>

    <script>
        var age = 20;
        var name = "iwen";
        var flag = true;
        var user = {};

        console.log("age:\t", age, "\t", typeof age);
        console.log("name:\t", name, "\t", typeof name);
        console.log("flag:\t", flag, "\t", typeof flag);
        console.log("user:\t", user, "\t", typeof user);
        console.log("[]:\t", [], "\t", typeof []);
        console.log("null:\t", null, "\t", typeof null);
        console.log("undefined:\t", undefined, "\t", typeof undefined);

    </script>
</body>

</html>